package com.tomecode.util.gui.component;

import java.awt.event.ActionListener;

import javax.swing.JButton;

/**
 * 
 * Helper for button
 * 
 * @author Frastia Tomas
 * 
 */
public final class Button extends JButton {

	private static final long serialVersionUID = 1566032851846132999L;

	public Button(String name, boolean enable, ActionListener actionListener) {
		super(name);
		this.setEnabled(enable);
		this.addActionListener(actionListener);
	}

	public Button(String name, ActionListener actionListener) {
		this(name, true, actionListener);
	}

	public final String toString() {
		return this.getName();
	}
}
